
// MIT License
// 
// Copyright (c) 2009-2017 Luca Piccioni
// 
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
// 
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
// 
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
// 
// This file is automatically generated

#pragma warning disable 649, 1572, 1573

// ReSharper disable RedundantUsingDirective
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Security;
using System.Text;

using Khronos;

// ReSharper disable CheckNamespace
// ReSharper disable InconsistentNaming
// ReSharper disable JoinDeclarationAndInitializer

namespace OpenGL
{
	public partial class Wgl
	{
		/// <summary>
		/// [WGL] Value of ERROR_INCOMPATIBLE_AFFINITY_MASKS_NV symbol.
		/// </summary>
		[RequiredByFeature("WGL_NV_gpu_affinity")]
		public const int ERROR_INCOMPATIBLE_AFFINITY_MASKS_NV = 0x20D0;

		/// <summary>
		/// [WGL] Value of ERROR_MISSING_AFFINITY_MASK_NV symbol.
		/// </summary>
		[RequiredByFeature("WGL_NV_gpu_affinity")]
		public const int ERROR_MISSING_AFFINITY_MASK_NV = 0x20D1;

		/// <summary>
		/// [WGL] wglEnumGpusNV: Binding for wglEnumGpusNV.
		/// </summary>
		/// <param name="iGpuIndex">
		/// A <see cref="T:uint"/>.
		/// </param>
		/// <param name="phGpu">
		/// A <see cref="T:IntPtr[]"/>.
		/// </param>
		[RequiredByFeature("WGL_NV_gpu_affinity")]
		public static bool EnumGpusNV(uint iGpuIndex, IntPtr[] phGpu)
		{
			bool retValue;

			unsafe {
				fixed (IntPtr* p_phGpu = phGpu)
				{
					Debug.Assert(Delegates.pwglEnumGpusNV != null, "pwglEnumGpusNV not implemented");
					retValue = Delegates.pwglEnumGpusNV(iGpuIndex, p_phGpu);
					LogCommand("wglEnumGpusNV", retValue, iGpuIndex, phGpu					);
				}
			}
			DebugCheckErrors(retValue);

			return (retValue);
		}

		/// <summary>
		/// [WGL] wglEnumGpuDevicesNV: Binding for wglEnumGpuDevicesNV.
		/// </summary>
		/// <param name="hGpu">
		/// A <see cref="T:IntPtr"/>.
		/// </param>
		/// <param name="iDeviceIndex">
		/// A <see cref="T:uint"/>.
		/// </param>
		/// <param name="lpGpuDevice">
		/// A <see cref="T:IntPtr"/>.
		/// </param>
		[RequiredByFeature("WGL_NV_gpu_affinity")]
		public static bool EnumGpuDevicesNV(IntPtr hGpu, uint iDeviceIndex, IntPtr lpGpuDevice)
		{
			bool retValue;

			Debug.Assert(Delegates.pwglEnumGpuDevicesNV != null, "pwglEnumGpuDevicesNV not implemented");
			retValue = Delegates.pwglEnumGpuDevicesNV(hGpu, iDeviceIndex, lpGpuDevice);
			LogCommand("wglEnumGpuDevicesNV", retValue, hGpu, iDeviceIndex, lpGpuDevice			);
			DebugCheckErrors(retValue);

			return (retValue);
		}

		/// <summary>
		/// [WGL] wglCreateAffinityDCNV: Binding for wglCreateAffinityDCNV.
		/// </summary>
		/// <param name="phGpuList">
		/// A <see cref="T:IntPtr[]"/>.
		/// </param>
		[RequiredByFeature("WGL_NV_gpu_affinity")]
		public static IntPtr CreateAffinityDCNV(IntPtr[] phGpuList)
		{
			IntPtr retValue;

			unsafe {
				fixed (IntPtr* p_phGpuList = phGpuList)
				{
					Debug.Assert(Delegates.pwglCreateAffinityDCNV != null, "pwglCreateAffinityDCNV not implemented");
					retValue = Delegates.pwglCreateAffinityDCNV(p_phGpuList);
					LogCommand("wglCreateAffinityDCNV", retValue, phGpuList					);
				}
			}
			DebugCheckErrors(retValue);

			return (retValue);
		}

		/// <summary>
		/// [WGL] wglEnumGpusFromAffinityDCNV: Binding for wglEnumGpusFromAffinityDCNV.
		/// </summary>
		/// <param name="hAffinityDC">
		/// A <see cref="T:IntPtr"/>.
		/// </param>
		/// <param name="iGpuIndex">
		/// A <see cref="T:uint"/>.
		/// </param>
		/// <param name="hGpu">
		/// A <see cref="T:IntPtr[]"/>.
		/// </param>
		[RequiredByFeature("WGL_NV_gpu_affinity")]
		public static bool EnumGpusFromAffinityDCNV(IntPtr hAffinityDC, uint iGpuIndex, IntPtr[] hGpu)
		{
			bool retValue;

			unsafe {
				fixed (IntPtr* p_hGpu = hGpu)
				{
					Debug.Assert(Delegates.pwglEnumGpusFromAffinityDCNV != null, "pwglEnumGpusFromAffinityDCNV not implemented");
					retValue = Delegates.pwglEnumGpusFromAffinityDCNV(hAffinityDC, iGpuIndex, p_hGpu);
					LogCommand("wglEnumGpusFromAffinityDCNV", retValue, hAffinityDC, iGpuIndex, hGpu					);
				}
			}
			DebugCheckErrors(retValue);

			return (retValue);
		}

		/// <summary>
		/// [WGL] wglDeleteDCNV: Binding for wglDeleteDCNV.
		/// </summary>
		/// <param name="hdc">
		/// A <see cref="T:IntPtr"/>.
		/// </param>
		[RequiredByFeature("WGL_NV_gpu_affinity")]
		public static bool DeleteDCNV(IntPtr hdc)
		{
			bool retValue;

			Debug.Assert(Delegates.pwglDeleteDCNV != null, "pwglDeleteDCNV not implemented");
			retValue = Delegates.pwglDeleteDCNV(hdc);
			LogCommand("wglDeleteDCNV", retValue, hdc			);
			DebugCheckErrors(retValue);

			return (retValue);
		}

		internal static unsafe partial class Delegates
		{
			[RequiredByFeature("WGL_NV_gpu_affinity")]
			[SuppressUnmanagedCodeSecurity]
			internal delegate bool wglEnumGpusNV(uint iGpuIndex, IntPtr* phGpu);

			[RequiredByFeature("WGL_NV_gpu_affinity")]
			internal static wglEnumGpusNV pwglEnumGpusNV;

			[RequiredByFeature("WGL_NV_gpu_affinity")]
			[SuppressUnmanagedCodeSecurity]
			internal delegate bool wglEnumGpuDevicesNV(IntPtr hGpu, uint iDeviceIndex, IntPtr lpGpuDevice);

			[RequiredByFeature("WGL_NV_gpu_affinity")]
			internal static wglEnumGpuDevicesNV pwglEnumGpuDevicesNV;

			[RequiredByFeature("WGL_NV_gpu_affinity")]
			[SuppressUnmanagedCodeSecurity]
			internal delegate IntPtr wglCreateAffinityDCNV(IntPtr* phGpuList);

			[RequiredByFeature("WGL_NV_gpu_affinity")]
			internal static wglCreateAffinityDCNV pwglCreateAffinityDCNV;

			[RequiredByFeature("WGL_NV_gpu_affinity")]
			[SuppressUnmanagedCodeSecurity]
			internal delegate bool wglEnumGpusFromAffinityDCNV(IntPtr hAffinityDC, uint iGpuIndex, IntPtr* hGpu);

			[RequiredByFeature("WGL_NV_gpu_affinity")]
			internal static wglEnumGpusFromAffinityDCNV pwglEnumGpusFromAffinityDCNV;

			[RequiredByFeature("WGL_NV_gpu_affinity")]
			[SuppressUnmanagedCodeSecurity]
			internal delegate bool wglDeleteDCNV(IntPtr hdc);

			[RequiredByFeature("WGL_NV_gpu_affinity")]
			internal static wglDeleteDCNV pwglDeleteDCNV;

		}
	}

}
